{% include "public/head.html" %}
{% include "public/left.html" %}
{% include "public/header.html" %}
<style>
    #Orders{
        position: absolute;
        top: 24px;
        left: 1250px;
    }
</style>
        <!--页面主要内容-->
        <main class="lyear-layout-content">

            <div class="container-fluid">

                <div class="row">
                    <div class="col-lg-12">
                        <div class="card">
                            <div class="card-toolbar clearfix">
                                <form class="pull-right search-bar" method="get" action="#!" role="form">
                                    <div class="input-group">
                                        <div class="input-group-btn">
                                            <input type="hidden" name="search_field" id="search-field" value="title">
                                            <button class="btn btn-default dropdown-toggle" id="search-btn" data-toggle="dropdown" type="button" aria-haspopup="true" aria-expanded="false">
                                                标题 <span class="caret"></span>
                                            </button>
                                            <ul class="dropdown-menu">
                                                <li> <a tabindex="-1" href="javascript:void(0)" data-field="title">标题</a> </li>
                                                <li> <a tabindex="-1" href="javascript:void(0)" data-field="cat_name">栏目</a> </li>
                                            </ul>
                                        </div>
                                        <input type="text" class="form-control" value="" name="keyword" placeholder="请输入名称">
                                    </div>
                                </form>
                                <div class="toolbar-btn-action">
                                    <a class="btn btn-primary m-r-5" href="{{url}}/admin/client/add"><i class="mdi mdi-plus"></i> 新增</a>
<!--                                    <a class="btn btn-success m-r-5" href="#!"><i class="mdi mdi-check"></i> 启用</a>-->
<!--                                    <a class="btn btn-warning m-r-5" href="#!"><i class="mdi"></i> 排序</a>-->
<!--                                    <a class="btn btn-danger" href="#!"><i class="mdi mdi-window-close"></i> 删除</a>-->
                                </div>
                            </div>
                            <div class="card-body">

                                <div class="table-responsive">
                                    <form action="/admin/client/order" method="post" class="row">
                                    <table class="table table-bordered">
                                        <thead>
                                        <tr>
                                            <th>
                                                <label class="lyear-checkbox checkbox-primary">
                                                    <input type="checkbox" id="check-all"><span></span>
                                                </label>
                                            </th>
                                            <th>编号</th>
                                            <th>名称</th>
                                            <th>简称</th>
                                            <th>状态</th>
                                            <th>地址</th>
                                            <th>负责人</th>
                                            <th>排序</th>
                                            <th>创建时间</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                            {% for v in client_list %}
                                            <tr>
                                                <td>
                                                    <label class="lyear-checkbox checkbox-primary">
                                                        <input type="checkbox" name="ids[]" value="1"><span></span>
                                                    </label>
                                                </td>
                                                <td>{{ v.id }}</td>
                                                <td>{{ v.client_name }}</td>
                                                <td>{{ v.client_abbre }}</td>
                                                <td><font class="text-success">{{ v.client_status }}</font></td>
                                                <td>{{ v.address }}</td>
                                                <td>{{ v.username }}</td>
                                                <td><input type="text" value="{{ v.order_open_close }}" name="orderS[{{v.id}}]"></td>
                                                <td>{{ v.create_time }}</td>
                                                <td>
                                                    <div class="btn-group">
                                                        <a class="btn btn-xs btn-default" href="/admin/client/edit/{{v.id}}" title="编辑" data-toggle="tooltip"><i class="mdi mdi-pencil"></i></a>
                                                        <a class="btn btn-xs btn-default" href="javascript:;" title="删除" data-toggle="tooltip" onclick="return del('{{v.id}}',this);"><i class="mdi mdi-window-close"></i></a>
                                                    </div>
                                                </td>
                                            </tr>
                                            {% endfor %}


                                        </tbody>
                                    </table>
                                        <div class="form-group">
                                            <button class="btn btn-primary" type="submit" id="Orders">排序</button>
                                        </div>
                                    </form>
                                </div>
                                <ul class="pagination">
                                    <li class="disabled"><span>«</span></li>
                                    <li class="active"><span>1</span></li>
                                    <li><a href="#1">2</a></li>
                                    <li><a href="#1">3</a></li>
                                    <li><a href="#1">4</a></li>
                                    <li><a href="#1">5</a></li>
                                    <li><a href="#1">6</a></li>
                                    <li><a href="#1">7</a></li>
                                    <li><a href="#1">8</a></li>
                                    <li class="disabled"><span>...</span></li>
                                    <li><a href="#!">14452</a></li>
                                    <li><a href="#!">14453</a></li>
                                    <li><a href="#!">»</a></li>
                                </ul>

                            </div>
                        </div>
                    </div>

                </div>

            </div>

        </main>
{% include "public/footer.html" %}
<script type="text/javascript">
        function del(id,event){
            let parentNodeS = event.parentNode.parentNode.parentNode;
            if(confirm('确定要删除吗?')){
                lightyear.loading('show');
                LH.get('/admin/client/delete/'+id,{
                    responseType : 'json'
                }).then((response) => {
                    if(response.status == 1){
                        lightyear.loading('hide');
                        lightyear.notify(response.message,'success',1000)
                        parentNodeS.style.display = 'none';
                    }
                    lightyear.loading('hide');  // 隐藏
                });
            }
        }
</script>
